package com.tutu.config;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.config.BeanPostProcessor;

import java.sql.SQLOutput;

/**
 * @Program: Spring_New
 * @Description: Bean后处理器，一般在Bean实例化之后，填充到单例池singletonObjects之前执行
 * @Author: JK.TuTu
 * @ @Version: 1.0
 * @Create: 2022-11-25 15:34
 **/
public class MyBeanPostProcessor implements BeanPostProcessor {

    @Override
    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
        System.out.println(beanName+":before");
        return bean;
    }

    @Override
    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
        System.out.println(beanName + ":after");
        return bean;
    }

    public void init(){
        System.out.println("xml标签的init-method方法");
    }


}
